package controllers;

import play.mvc.*;
import play.data.validation.*;

@With(Secure.class)
public class Research extends Controller {
	public static void index(@Required String keywords) {
		Api myApi = new Api();
		String total_sales = "";
		String total_sold_items = "";
		String average_sold_price = "";
		if(keywords != null){
			total_sales = myApi.priceResearch("total_sales", keywords);
			total_sold_items = myApi.priceResearch("total_sold_items", keywords);
			average_sold_price = myApi.priceResearch("average_sold_price", keywords);
		}
		String user = Security.connected();
		render(user, total_sales, total_sold_items, average_sold_price, keywords);
	}
}